package com.wiki.gds.base.common.exception;


import com.wiki.gds.base.common.constants.AppConstant;

public enum BizExceptionEnum {
    /**
     * 系统3类：成功 失败 登录失效
     */

    /**
     * 成功操作类
     */
    SUCCESSFUL_OPERATION(AppConstant.Code.SUCCESS,"操作成功"),
    FAIL_OPERATION(AppConstant.Code.FAIL,"操作失败"),

    /**
     * 异常问题描述
     */
    SYSTEM_EEROR(AppConstant.Code.ERROR,"系统异常"),
    API_EEROR(AppConstant.Code.ERROR,"API调用异常"),

    /**
     * 登录相关
     */
    NOT_LOGIN(AppConstant.Code.NOT_LOGIN,"登录失效"),

    LOGIN_NO_USER(AppConstant.Code.FAIL,"账号不存在"),

    LOGIN_PASSWORD_ERROR(AppConstant.Code.FAIL,"密码错误"),

    LOGIN_PASSWORD_NULL(AppConstant.Code.FAIL,"密码不能为空"),

    LOGIN_USERNAME_ERROR(AppConstant.Code.FAIL,"用户名不能为空"),

    PHONE_NUM_NULL(AppConstant.Code.FAIL,"电话号码为空"),

    V_CODE_NULL(AppConstant.Code.FAIL,"验证码不能为空"),

    V_CODE_ERROR(AppConstant.Code.FAIL,"验证码错误"),

    PHONE_NUM_ERROR(AppConstant.Code.FAIL,"电话号码错误"),

    IDCARD_HAS_REGISTER(AppConstant.Code.FAIL,"该身份证已经申请借款"),
    IDCARD_NO_RECORD(AppConstant.Code.FAIL,"该身份证没有绑卡记录，无法重新绑卡"),
    IDCARD_NO_CHANGE(AppConstant.Code.FAIL,"银行卡未变更，无法重新绑卡"),
    IDCARD_NO_SIGN(AppConstant.Code.FAIL,"该用户有卡未签约，无法重新绑卡"),



    /**
     * 返回错误描述
     */
    ORDER_STATUS_ERROR(AppConstant.Code.FAIL,"订单状态有误"),
    REQUEST_PARAMS_NULL(AppConstant.Code.FAIL,"请求参数为空"),
    REQUEST_PARAMS_EEROR(AppConstant.Code.FAIL,"参数错误"),
    REQUEST_FAILED(AppConstant.Code.FAIL,"操作失败"),


    /**
     * 我要借款跳转逻辑码
     */
    //去绑卡
    BORROWER_MONEY_TO_BANKCARD("101",AppConstant.Msg.SUCCESS),
    //去认证
     BORROWER_MONEY_TO_AUTH("102",AppConstant.Msg.SUCCESS),


    /*
     *银行卡挂钩
     */
    BANK_CARD_ERROR(AppConstant.Code.FAIL,"银行卡格式不正确"),
    BANK_CARD_DODING(AppConstant.Code.FAIL,"银行卡正在重新绑定"),


    /*
     * 个人信息相关
     */
    PERSON_IDCARD_ERROR(AppConstant.Code.FAIL,"身份证格式不正确"),
    PERSON_NAME_ERROR(AppConstant.Code.FAIL,"名字不合法"),
    PERSON_PHONE_ERROR(AppConstant.Code.FAIL,"手机号不合法"),





    /**
     * 登录及账户问题
     */
    USER_ALREADY_REG(AppConstant.Code.FAIL,"该用户已经注册"),
    NO_THIS_USER(AppConstant.Code.FAIL,"没有此用户"),
    ACCOUNT_FREEZED(AppConstant.Code.FAIL, "账号被冻结"),
    OLD_PWD_NOT_RIGHT(AppConstant.Code.FAIL, "原密码不正确"),
    TWO_PWD_NOT_MATCH(AppConstant.Code.FAIL, "两次输入密码不一致"),


    /**
     * 文件上传
     */
    FILE_READING_ERROR(AppConstant.Code.FAIL,"FILE_READING_ERROR!"),
    FILE_NOT_FOUND(AppConstant.Code.FAIL,"FILE_NOT_FOUND!"),
    UPLOAD_ERROR(AppConstant.Code.FAIL,"上传图片出错"),

    /**
     * 权限和数据问题
     */
    DB_RESOURCE_NULL(AppConstant.Code.FAIL,"数据库中没有该资源"),
    NO_PERMITION(AppConstant.Code.FAIL, "仅超级管理员可以操作"),
    REQUEST_INVALIDATE(AppConstant.Code.FAIL,"请求数据格式不正确"),
    INVALID_KAPTCHA(AppConstant.Code.FAIL,"验证码不正确"),
    CANT_DELETE_ADMIN(AppConstant.Code.FAIL,"不能删除超级管理员"),
    CANT_FREEZE_ADMIN(AppConstant.Code.FAIL,"不能冻结超级管理员"),
    CANT_CHANGE_ADMIN(AppConstant.Code.FAIL,"不能修改超级管理员角色"),

    /**
     * 错误的请求
     */
    DICT_MUST_BE_NUMBER(AppConstant.Code.FAIL,"字典的值必须为数字"),
    REQUEST_NULL(AppConstant.Code.FAIL, "请求有错误"),
    SESSION_TIMEOUT(AppConstant.Code.FAIL, "会话超时");

    BizExceptionEnum(String code, String message) {
        this.friendlyCode = code;
        this.friendlyMsg = message;
    }

    BizExceptionEnum(String code, String message,String urlPath) {
        this.friendlyCode = code;
        this.friendlyMsg = message;
        this.urlPath = urlPath;
    }

    private String friendlyCode;

    private String friendlyMsg;

    private String urlPath;

    public String getCode() {
        return friendlyCode;
    }

    public void setCode(String code) {
        this.friendlyCode = code;
    }

    public String getMessage() {
        return friendlyMsg;
    }

    public void setMessage(String message) {
        this.friendlyMsg = message;
    }

    public String getUrlPath() {
        return urlPath;
    }

    public void setUrlPath(String urlPath) {
        this.urlPath = urlPath;
    }
}
